3.1.12 \(\int x (a+b \text {sech}(c+d x^2))^2 \, dx\) [12]

Optimal. Leaf size=44 \[ \frac {a^2 x^2}{2}+\frac {a b \text {ArcTan}\left (\sinh \left (c+d x^2\right )\right )}{d}+\frac {b^2 \tanh \left (c+d x^2\right )}{2 d} \]

[Out]

1/2*a^2*x^2+a*b*arctan(sinh(d*x^2+c))/d+1/2*b^2*tanh(d*x^2+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {5544, 3858, 3855, 3852, 8} \begin {gather*} \frac {a^2 x^2}{2}+\frac {a b \text {ArcTan}\left (\sinh \left (c+d x^2\right )\right )}{d}+\frac {b^2 \tanh \left (c+d x^2\right )}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*(a + b*Sech[c + d*x^2])^2,x]

[Out]

(a^2*x^2)/2 + (a*b*ArcTan[Sinh[c + d*x^2]])/d + (b^2*Tanh[c + d*x^2])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3858

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^2, x_Symbol] :> Simp[a^2*x, x] + (Dist[2*a*b, Int[Csc[c + d*x], x],
 x] + Dist[b^2, Int[Csc[c + d*x]^2, x], x]) /; FreeQ[{a, b, c, d}, x]

Rule 5544

Int[(x_)^(m_.)*((a_.) + (b_.)*Sech[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simpli
fy[(m + 1)/n] - 1)*(a + b*Sech[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplif
y[(m + 1)/n], 0] && IntegerQ[p]

Rubi steps

\begin {align*} \int x \left (a+b \text {sech}\left (c+d x^2\right )\right )^2 \, dx &=\frac {1}{2} \text {Subst}\left (\int (a+b \text {sech}(c+d x))^2 \, dx,x,x^2\right )\\ &=\frac {a^2 x^2}{2}+(a b) \text {Subst}\left (\int \text {sech}(c+d x) \, dx,x,x^2\right )+\frac {1}{2} b^2 \text {Subst}\left (\int \text {sech}^2(c+d x) \, dx,x,x^2\right )\\ &=\frac {a^2 x^2}{2}+\frac {a b \tan ^{-1}\left (\sinh \left (c+d x^2\right )\right )}{d}+\frac {\left (i b^2\right ) \text {Subst}\left (\int 1 \, dx,x,-i \tanh \left (c+d x^2\right )\right )}{2 d}\\ &=\frac {a^2 x^2}{2}+\frac {a b \tan ^{-1}\left (\sinh \left (c+d x^2\right )\right )}{d}+\frac {b^2 \tanh \left (c+d x^2\right )}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 44, normalized size = 1.00 \begin {gather*} \frac {a \left (a \left (c+d x^2\right )+2 b \text {ArcTan}\left (\sinh \left (c+d x^2\right )\right )\right )+b^2 \tanh \left (c+d x^2\right )}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*Sech[c + d*x^2])^2,x]

[Out]

(a*(a*(c + d*x^2) + 2*b*ArcTan[Sinh[c + d*x^2]]) + b^2*Tanh[c + d*x^2])/(2*d)

________________________________________________________________________________________

Maple [C] Result contains complex when optimal does not.
time = 1.56, size = 73, normalized size = 1.66

method result size
risch \(\frac {a^{2} x^{2}}{2}-\frac {b^{2}}{d \left (1+{\mathrm e}^{2 d \,x^{2}+2 c}\right )}+\frac {i b a \ln \left ({\mathrm e}^{d \,x^{2}+c}+i\right )}{d}-\frac {i b a \ln \left ({\mathrm e}^{d \,x^{2}+c}-i\right )}{d}\) \(73\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*sech(d*x^2+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/2*a^2*x^2-b^2/d/(1+exp(2*d*x^2+2*c))+I*b*a/d*ln(exp(d*x^2+c)+I)-I*b*a/d*ln(exp(d*x^2+c)-I)

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 46, normalized size = 1.05 \begin {gather*} \frac {1}{2} \, a^{2} x^{2} + \frac {a b \arctan \left (\sinh \left (d x^{2} + c\right )\right )}{d} + \frac {b^{2}}{d {\left (e^{\left (-2 \, d x^{2} - 2 \, c\right )} + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*sech(d*x^2+c))^2,x, algorithm="maxima")

[Out]

1/2*a^2*x^2 + a*b*arctan(sinh(d*x^2 + c))/d + b^2/(d*(e^(-2*d*x^2 - 2*c) + 1))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 194 vs. \(2 (40) = 80\).
time = 0.37, size = 194, normalized size = 4.41 \begin {gather*} \frac {a^{2} d x^{2} \cosh \left (d x^{2} + c\right )^{2} + 2 \, a^{2} d x^{2} \cosh \left (d x^{2} + c\right ) \sinh \left (d x^{2} + c\right ) + a^{2} d x^{2} \sinh \left (d x^{2} + c\right )^{2} + a^{2} d x^{2} - 2 \, b^{2} + 4 \, {\left (a b \cosh \left (d x^{2} + c\right )^{2} + 2 \, a b \cosh \left (d x^{2} + c\right ) \sinh \left (d x^{2} + c\right ) + a b \sinh \left (d x^{2} + c\right )^{2} + a b\right )} \arctan \left (\cosh \left (d x^{2} + c\right ) + \sinh \left (d x^{2} + c\right )\right )}{2 \, {\left (d \cosh \left (d x^{2} + c\right )^{2} + 2 \, d \cosh \left (d x^{2} + c\right ) \sinh \left (d x^{2} + c\right ) + d \sinh \left (d x^{2} + c\right )^{2} + d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*sech(d*x^2+c))^2,x, algorithm="fricas")

[Out]

1/2*(a^2*d*x^2*cosh(d*x^2 + c)^2 + 2*a^2*d*x^2*cosh(d*x^2 + c)*sinh(d*x^2 + c) + a^2*d*x^2*sinh(d*x^2 + c)^2 +
 a^2*d*x^2 - 2*b^2 + 4*(a*b*cosh(d*x^2 + c)^2 + 2*a*b*cosh(d*x^2 + c)*sinh(d*x^2 + c) + a*b*sinh(d*x^2 + c)^2
+ a*b)*arctan(cosh(d*x^2 + c) + sinh(d*x^2 + c)))/(d*cosh(d*x^2 + c)^2 + 2*d*cosh(d*x^2 + c)*sinh(d*x^2 + c) +
 d*sinh(d*x^2 + c)^2 + d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x \left (a + b \operatorname {sech}{\left (c + d x^{2} \right )}\right )^{2}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*sech(d*x**2+c))**2,x)

[Out]

Integral(x*(a + b*sech(c + d*x**2))**2, x)

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 55, normalized size = 1.25 \begin {gather*} \frac {{\left (d x^{2} + c\right )} a^{2}}{2 \, d} + \frac {2 \, a b \arctan \left (e^{\left (d x^{2} + c\right )}\right )}{d} - \frac {b^{2}}{d {\left (e^{\left (2 \, d x^{2} + 2 \, c\right )} + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*sech(d*x^2+c))^2,x, algorithm="giac")

[Out]

1/2*(d*x^2 + c)*a^2/d + 2*a*b*arctan(e^(d*x^2 + c))/d - b^2/(d*(e^(2*d*x^2 + 2*c) + 1))

________________________________________________________________________________________

Mupad [B]
time = 0.10, size = 77, normalized size = 1.75 \begin {gather*} \frac {a^2\,x^2}{2}+\frac {2\,\mathrm {atan}\left (\frac {a\,b\,{\mathrm {e}}^{d\,x^2}\,{\mathrm {e}}^c\,\sqrt {d^2}}{d\,\sqrt {a^2\,b^2}}\right )\,\sqrt {a^2\,b^2}}{\sqrt {d^2}}-\frac {b^2}{d\,\left ({\mathrm {e}}^{2\,d\,x^2+2\,c}+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a + b/cosh(c + d*x^2))^2,x)

[Out]

(a^2*x^2)/2 + (2*atan((a*b*exp(d*x^2)*exp(c)*(d^2)^(1/2))/(d*(a^2*b^2)^(1/2)))*(a^2*b^2)^(1/2))/(d^2)^(1/2) -
b^2/(d*(exp(2*c + 2*d*x^2) + 1))

________________________________________________________________________________________